<!-- loop flats -->
	<div class='main-site-content-appartements-content-text-flat'>							
			<div style='display: none' class='flat-ref'>{{flats' value.@cha_id}}</div>
			<div class="main-site-content-appartements-content-text-flat-preview">
				<img src="{{baseurl}}global/img/appartements/pictures/thumbnails/<?php  echo $data['pictures'][$v1->cha_id]['pictures'][0]?>" alt='<?php echo $data['pictures'][$v1->cha_id]['alt']?>'>
				<div class='main-site-content-appartements-content-tex-flat-content'>
					<div class='main-site-content-appartements-content-tex-flat-content-line'><span class='bold'>Emplacement </span>: {{flats' value.@FrbFlatImmeuble.@imm_adr}} à Marseille</div>
					<div class='main-site-content-appartements-content-tex-flat-content-line'><span class='bold'>Surface</span> : {{flats' value.@cha_surf}} m²</div>
					<div class='main-site-content-appartements-content-tex-flat-content-line'> 
						<span class='bold'>Loyer à l'année</span> : {{flats' value.@cha_loy_low}} €/mois 
						<span class='bold'> Pleine saison </span>: <a href='{{baseurl}}contact' class='frb-popup-shadow'>nous contacter</a></div>
					<div class='main-site-content-appartements-content-tex-flat-content-line'><span class='bold'>Description : </span>{{flats' value.@cha_det}}</div>
				</div>
				
		</div>
		<div class="show-detail">+ d'infos</div>
		<div class="main-site-content-appartements-content-text-flat-images"></div>
	</div>
<!-- endloop -->
<script type="text/javascript">

var oldToggle=null;

$('.show-detail').click(function(){
	t = $(this).parent(".main-site-content-appartements-content-text-flat");
	var flat = t.children(".flat-ref").html();
	if(t.css('height') == '100px'){
		t.prevAll('.main-site-content-appartements-content-text-flat').hide('normal');
		t.animate({height : '300px'});
		if(oldToggle != null)
			oldToggle.animate({height : '100px'});
		oldToggle = t;
		$.ajax({
			url: '{{baseurl}}getFlatPictures?flat='+flat,
			type: 'GET',
			cache: false,
			success: function(html){
				t.children(".main-site-content-appartements-content-text-flat-images").html(html);
			}
		});
	}else if(t.css('height') == '300px'){
		oldToggle = null;
		t.animate({height : '100px'});
		$('.main-site-content-appartements-content-text-flat').show('normal');
	}
});
</script>